package com.wanma.recuit.bosscontroller;

import com.wanma.recuit.pojo.Company;
import com.wanma.recuit.pojo.CompanyUser;
import com.wanma.recuit.service.CompanyInfoService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Controller
public class CompanyInfoController {
    @Resource
    private CompanyInfoService companyInfoService;
    @GetMapping("/bossmanage/companyinfo")
    public ModelAndView companyInfo(ModelAndView modelAndView,HttpServletRequest request){
        HttpSession session = request.getSession();
        CompanyUser companyUser = (CompanyUser)session.getAttribute("companyUser");
        //去取出公司所有的信息
        Company company = companyInfoService.findCompany(companyUser);
        session.setAttribute("company",company);
        modelAndView.addObject("company",company);
        return  modelAndView;

    }
}
